.\" roar_simple_play.3:

.TH "roar_str2codec" "3" "July 2008" "RoarAudio" "System Manager's Manual: RoarAuido"

.SH NAME
roar_str2codec \- Get codec ID by codec name

roar_codec2str \- Get codec name by ID

.SH SYNOPSIS

 #include <roaraudio.h>

 int    roar_str2codec (char * codec);
 char * roar_codec2str (int    codec);

.SH "DESCRIPTION"
\fBroar_str2codec\fR converts a string to a RoarAudio Codec ID. It also supports some common aliases.
\fBroar_codec2str\fR is the reverse operation of \fBroar_str2codec\fR: It get's a name by the ID given.
If a \fBcodec\fR is valid the following should be true:
 roar_str2codec(roar_codec2str(codec)) == codec

Note that because of aliasing and case insensitivity the revers operation needs not to be true.

.SH "THREAD SAFETY"
Because \fBroar_codec2str\fR returns a static unique pointer for each codec it is fully thread safe.

.SH "RETURN VALUE"
On success \fBroar_str2codec\fR returns a codec ID.  On error, \-1 is returned.
\fBroar_codec2str\fR returns the name of the codec or NULL on error.
You must not free this pointer or write to it.

.SH "EXAMPLES"
FIXME

.SH "SEE ALSO"
\fBlibroar\fR(7),
\fBRoarAudio\fR(7).

.\" ll
